<template>
	<view class="safe-bottom">
		<view class="bg-white">
			<u-form :model="form" ref="uForm" labelWidth="250">
				<view class="u-p-x-30">
					<u-form-item label="商户名称" prop="store_name">
						<u-input v-model="form.store_name"  placeholder="请填写与营业执照相符的名称"/>
					</u-form-item>
					<u-form-item label="商户简称" prop="short_name">
						<u-input v-model="form.short_name"  placeholder="请填写商户简称"/>
					</u-form-item>
					<u-form-item label="联系人" prop="contact">
						<u-input v-model="form.contact" placeholder="请填写店铺联系人姓名"/>
					</u-form-item>
					<u-form-item label="联系人电子邮箱" prop="contact_email">
						<u-input v-model="form.contact_email " placeholder="请填写联系人电子邮箱"/>
					</u-form-item>
					<u-form-item label="联系人银行账户" prop="bank_account">
						<u-input v-model="form.bank_account " type="number" placeholder="请填写联系人银行账户"/>
					</u-form-item>
					<u-form-item label="银行卡开户人姓名" prop="card_name">
						<u-input v-model="form.card_name" type="textarea" height="50" placeholder="请填写银行卡开户人姓名"/>
					</u-form-item>
					<!-- <u-form-item label="银行卡正面照片" prop="bank_image">
						<u-upload :auto-upload="false" ref="uUpload4" max-count="1" width="150" height="150"></u-upload>
					</u-form-item> -->
					<u-form-item label="银行名称" prop="bank_name">
            <view style="width: 100%;" @click="applyBankShow = true">
              <u-input style="pointer-events: none" v-model="form.bank_name" type="select" />
            </view>
					</u-form-item>
					<u-form-item label="银行所在省市" prop="bankRegion">
            <view style="width: 100%;" @click="showbankRegion = true">
              <u-input style="pointer-events: none" v-model="form.bankRegion" type="select" placeholder="请选择银行所在省市" />
            </view>
					</u-form-item>
				</view>
				<u-gap height="10" bg-color="#e5e5e5"></u-gap>
				<view class="u-p-x-30">
					<u-form-item label="主营项目" prop="store_zy">
						<u-input v-model="form.store_zy" placeholder="请填写主营项目"/>
					</u-form-item>
					<u-form-item label="商户分类" prop="type">
						<u-radio-group v-model="form.type" @change="changeType">
							<u-radio :name="1"> 线上商户 </u-radio>
							<u-radio :name="2"> 线下商户 </u-radio>
						</u-radio-group>
					</u-form-item>
					<u-form-item label="经度" prop="lng">
						<u-input v-model="form.lng" type="textarea" height="50" placeholder="请填写店铺经度"/>
					</u-form-item>
					<u-form-item label="纬度" prop="lat">
						<u-input v-model="form.lat" type="textarea" height="50" placeholder="请填写店铺纬度"/>
					</u-form-item>
					<u-form-item label="经纬度查询">
						<text style="color: blue;" @click="$copy('http://jingweidu.757dy.com/')">点击复制经纬度查询地址</text>
					</u-form-item>
					<u-form-item label="商户分类" prop="category_name">
            <view style="width: 100%;" @click="show = true">
              <u-input style="pointer-events: none" v-model="form.category_name" type="select" />
            </view>
					</u-form-item>
					<u-form-item label="公司类型" prop="ent_type_name">
            <view style="width: 100%;" @click="entTypeShow = true">
              <u-input style="pointer-events: none" v-model="form.ent_type_name" type="select" />
            </view>
					</u-form-item>
					<u-form-item label="物品类型" prop="goods_type_name" v-if="form.type==2">
            <view style="width: 100%;" @click="goodsTypeShow = true">
              <u-input style="pointer-events: none" v-model="form.goods_type_name" type="select" />
            </view>
					</u-form-item>
					<u-form-item label="商家logo" prop="logo_image">
						<u-upload @on-choose-complete="uploadSuccess" index="logo_image" :file-list="log.logo_image ? [{url:log.logo_image}] : []" ref="uUpload1" max-count="1" :max-size="2 * 1024 * 1024" :show-tips="false" @on-oversize="oversize" width="150" height="150"></u-upload>
					</u-form-item>
					<u-form-item label="所在地区" prop="region">
            <view style="width: 100%;" @click="showRegion = true">
						<u-input style="pointer-events: none" v-model="form.region" type="select"/>
            </view>
					</u-form-item>
					<u-form-item label="汇付所属行业" prop="mcc_name">
            <view style="width: 100%;" @click="mccShow = true">
						  <u-input style="pointer-events: none" v-model="form.mcc_name" type="select"/>
            </view>
					</u-form-item>
					<u-form-item label="法人姓名" prop="legal_name">
						<u-input v-model="form.legal_name" placeholder="请填写法人姓名"/>
					</u-form-item>
					<u-form-item label="法人证件有效期" prop="legal_cert_validity_type">
						<u-radio-group v-model="form.legal_cert_validity_type" @change="radioChange('legal_cert_validity_type')">
							<u-radio :name="1"> 长期有效 </u-radio>
							<u-radio :name="0"> 非长期有效 </u-radio>
						</u-radio-group>
					</u-form-item>
					<u-form-item label="法人证件开始日期" prop="legalCertStartDate">
            <view style="width: 100%;" @click="legalCertStartShow = true">
						  <u-input style="pointer-events: none" v-model="form.legalCertStartDate" type="select" placeholder="请选择法人证件有效期" />
            </view>
					</u-form-item>
					<u-form-item label="法人证件结束日期" prop="legalCertEndDate">
            <view style="width: 100%;" @click="legalCertEndShow = true">
              <u-input style="pointer-events: none" v-model="form.legalCertEndDate" type="select" placeholder="请选择法人证件结束日期" />
            </view>
					</u-form-item>
					<u-form-item label="法人身份证号码" prop="legal_cert_no">
						<u-input v-model="form.legal_cert_no" placeholder="请填写法人身份证号码"/>
					</u-form-item> 
					<u-form-item label="法人身份证地址" prop="legal_addr">
						<u-input v-model="form.legal_addr" placeholder="请填写法人身份证地址"/>
					</u-form-item> 
					<u-form-item label="详细地址" prop="address">
						<u-input v-model="form.address" type="textarea" height="50" placeholder="请填写店铺详细地址"/>
					</u-form-item>
					<u-form-item label="商户简介" prop="store_abstract">
						<view class="flex-1 u-p-x-5" style="background-color: #f5f5f5;">
							<u-input v-model="form.store_abstract" maxlength="100" type="textarea" placeholder="请填写商户简介"/>
						</view>
					</u-form-item>
					<text class="up-y-20 u-font-30 text-greey">请上传一张店铺门面照片和两张店内照片</text>
					<view class="flex">
						<u-form-item label="门面" prop="face_image" labelWidth="80">
							<u-upload @on-choose-complete="uploadSuccess" index="face_image" :file-list="log.face_image ? [{url:log.face_image}] : []" ref="uUpload2" max-count="1" :max-size="2 * 1024 * 1024" :show-tips="false" @on-oversize="oversize" width="150" height="150"></u-upload>
						</u-form-item>
						<u-form-item label="店内" prop="inside_images" labelWidth="80">
							<u-upload @on-choose-complete="uploadSuccess" index="inside_images" :file-list="log.inside_images ? [{url:log.inside_images[0]},{url:log.inside_images[1]}] : []" ref="uUpload3" max-count="2" :max-size="2 * 1024 * 1024" :show-tips="false" @on-oversize="oversize" width="150" height="150"></u-upload>
						</u-form-item>
					</view>
				</view>
			</u-form>
		</view>
		<view class="text-center bg-white u-p-b-30" >
			<dy-button width="576rpx" size="default" @click="submit">提交</dy-button>
		</view>
		<u-select v-model="show" :list="typeList" label-name="name" value-name="id" @confirm="confirm"></u-select>
		<u-select v-model="goodsTypeShow" :list="goodsTypeList" label-name="name" value-name="id" @confirm="goodsTypeConfirm"></u-select>
		<u-select v-model="entTypeShow" :list="entTypeList" label-name="name" value-name="id" @confirm="entTypeConfirm"></u-select>
		<u-picker v-model="mccShow" :range="[mccList,mccList2,mccList3]" range-key="name" mode="multiSelector" :default-selector="mccSelector" @confirm="mccConfirm" @columnchange="mccColumnchange"></u-picker>
		<u-select v-model="applyBankShow" :list="applyBankList" label-name="name" value-name="code" @confirm="applyBankConfirm"></u-select>
		<u-picker v-model="showRegion" mode="region" @confirm="confirmRegion"></u-picker>
		<!-- <u-picker v-model="showbankRegion" :params="{ province: true, city: true, area: false }" mode="region" @confirm="confirmBankRegion"></u-picker> -->
		<u-picker v-model="showbankRegion" :range="AreaList" mode="multiSelector" range-key="name" :default-selector="select"
			@confirm="confirmBankRegion" @columnchange="columnchange"></u-picker>
		<u-picker mode="time" v-model="certStartShow" @confirm="certStartChange" :params="{
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				}"></u-picker>
		<u-picker mode="time" v-model="certEndShow" @confirm="certEndChange" :params="{
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				}"></u-picker>
		<u-picker mode="time" v-model="legalCertStartShow" @confirm="legalCertStartChange" :params="{
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				}"></u-picker>
		<u-picker mode="time" v-model="legalCertEndShow" @confirm="legalCertEndChange" :params="{
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				}"></u-picker>
	</view>
</template>

<script>
	import { baseImgUrl } from "@/api/app.js"
	import { SupplierCenterApi,MineCenterApi  } from '@/api/serves.js'
	import { mapActions } from 'vuex'
	export default {
		data() {
			return {
				AreaList:[],
				select:[0,0],
				action: baseImgUrl+ '/api/user/upload', 
				show: false,
				showRegion: false,
				showbankRegion: false,
				mccShow: false,
				applyBankShow: false,
				certStartShow: false,
				certEndShow: false,
				legalCertStartShow: false,
				legalCertEndShow: false,
				goodsTypeShow: false,
				entTypeShow: false,
				goodsTypeList: [
					{ id: 2 , name: "快餐美食"},
					{ id: 13 , name: "水果生鲜"},
					{ id: 4 , name: "日用百货"},
					{ id: 5 , name: "蛋糕甜品"},
					{ id: 6 , name: "鲜花绿植"},
					{ id: 1 , name: "文件证件"},
					{ id: 7 , name: "手机数码"},
					{ id: 14 , name: "龙虾烧烤"},
					{ id: 15 , name: "火锅串串"},
					{ id: 16 , name: "成人用品"},
					{ id: 11 , name: "医药健康"},
					{ id: 12 , name: "其他"}
				],
				entTypeList: [
					{ id: 1 , name: "政府机构"},
					{ id: 2 , name: "国营企业"},
					{ id: 3 , name: "私营企业"},
					{ id: 4 , name: "外资企业"},
					{ id: 5 , name: "个体工商户"},
					{ id: 7 , name: "事业单位"},
				],
				typeList: [],
				mccList: [],
				mccList2: [],
				mccList3: [],
				applyBankList: [],
				mccSelector: [0,0,0],
				log:{},
				form: {
					store_name: '',
					short_name: '',
					contact: '',
					contact_email: '',
					bank_account: '',
					bank_name: '',
					store_zy: '',
					type: 1,    
					lng: '',    
					lat: '',    
					category_name: '',
					category_id: '',
					goods_type_id: '',    
					goods_type_name: '',    
					logo_image: '',    // 店铺logo
					region: '',
					bank_code: '',
					mcc_name: '',
					mcc: '',
					card_name: '',
					bank_image: '',
					bankRegion: '',
					bank_prov_id: '',
					bank_area_id: '',
					card_no: '',
					cert_validity_type: 1,
					legal_cert_validity_type: 1,
					certStartDate: '',
					certEndDate: '',
					cert_begin_date: '',
					cert_end_date: '',
					legal_name: '',
					legal_cert_no: '',
					legal_addr: '',
					legalCertStartDate: '',
					legal_cert_begin_date: '',
					legal_cert_end_date: '',
					merch_level: 1,    
					address: '',
					store_abstract: '',
					face_image: '',   // 门面照片
					inside_images: '' // 门面照片
				},
				rules: {
					store_name: [{required: true,message: '请输入商户名称',trigger: ['blur', 'change']}],
					short_name: [{required: true,message: '请输入商户简称',trigger: ['blur', 'change']}],
					contact: [{required: true,message: '请输入联系人',trigger: ['blur', 'change']}],
					contact_email: [
						{
							required: true,
							message: '请输入正确的邮箱',
							trigger: ['blur', 'change']
						},
						{
							validator: (rule, value, callback) => {
								if (!this.$u.test.email(value)) {
									callback(new Error("请输入正确的邮箱"));
								} else {
									callback();
								}
							}
						},
					],
					bank_account: [{
						required: true,
						message: '请输入银行账号',
						trigger: ['blur', 'change']
					}],
					bank_name: [{
						required: true,
						message: '请输入银行名称',
						trigger: ['blur', 'change']
					}],
					store_zy: [{
						required: true,
						message: '请输入主营项目',
						trigger: ['blur', 'change']
					}],
					category_name: [{
						required: true,
						message: '请选择商户分类',
						trigger: ['blur', 'change']
					}],
					lng: [{
						required: true,
						message: '请输入经度',
						trigger: ['blur', 'change']
					}],
					lat: [{
						required: true,
						message: '请输入纬度',
						trigger: ['blur', 'change']
					}],
					goods_type_name: [
						{
							validator: (rule, value, callback) => {
								if (!this.form.goods_type_id&&this.form.type==2) {
									callback(new Error("请选择物品类型"));
								} else {
									callback();
								}
							}
						},
					],
					ent_type_name: [
						{
							validator: (rule, value, callback) => {
								if (!this.form.ent_type) {
									callback(new Error("请选择公司类型"));
								} else {
									callback();
								}
							}
						},
					],
					region: [{
						required: true,
						message: '请选择地区',
						trigger: ['blur', 'change']
					}],
					mcc_name: [
						{
							validator: (rule, value, callback) => {
								if (!this.form.goods_type_id&&this.form.type==2) {
									callback(new Error("请选择汇付所属行业"));
								} else {
									callback();
								}
							}
						},
					],
					card_name: [{
						required: true,
						message: '请填写银行卡开户人姓名',
						trigger: ['blur', 'change']
					}],
					bankRegion: [{
						required: true,
						message: '请选择银行所在省市',
						trigger: ['blur', 'change']
					}],
					legal_name: [{required: true,message: '请输法人姓名',trigger: ['blur', 'change']}],
					legal_cert_no: [
						{
							validator: (rule, value, callback) => {
								console.log(this.$u.test.idCard(value));
								if (this.$u.test.idCard(value)) {
										callback();
									} else {
										callback(new Error("请输入正确的身份证号码"));
								}
							}
						},
					],
					legal_addr: [{
						required: true,
						message: '请输入法人身份证地址',
						trigger: ['blur', 'change']
					}],
					legalCertStartDate: [{
						required: true,
						message: '请选择法人证件开始日期',
						trigger: ['blur', 'change']
					}],
					legalCertEndDate: [{
						validator: (rule, value, callback) => {
							if (this.form.legal_cert_validity_type == 0 && !value) {
									callback(new Error("请选择法人证件结束日期"));
								} else {
									callback();
							}
						}
					},],
					address: [{
						required: true,
						message: '请输入详细地址',
						trigger: ['blur', 'change']
					}],
					
					store_abstract: [{
						required: true,
						message: '请输入商户简介',
						trigger: ['blur', 'change']
					}],
				},

			};
		},
		onLoad() {
			let applyForm = uni.getStorageSync('applyForm_1') || {}
			if(applyForm) this.form = { ...this.form, applyForm}
			console.log('applyForm', applyForm);
		},
		onUnload() {
			uni.removeStorageSync('applyForm_1')
			uni.removeStorageSync('applyForm_2')
			uni.removeStorageSync('applyForm_3')
		},
		onReady() {
			this.$refs.uForm.setRules(this.rules);
			this._merchCategorys()
			this._getMccList()
			this._getApplyBankList()
		},
		async mounted() {
			// 初始化银行省市信息
			let p1 = SupplierCenterApi.getArea({
				level:1,
			})
			let p2 = SupplierCenterApi.getArea({
				level:2,
				p_id:1
			})
			let areaList = await Promise.all([p1,p2])
			this.AreaList = [areaList[0].data,areaList[1].data]
			console.log('省',this.AreaList);
			
			this._applyIndex()
		},
		methods: {
			...mapActions({ upload:'user/upload' }),
			_applyIndex() {
				uni.showLoading()
				MineCenterApi.applyIndex().then(res => {
				  console.log('入驻配置信息', res);
					uni.hideLoading()
					if(res.code == 1 && res.data.log && res.data.log.id){
						this.form = {
						...this.form,
						...res.data.log
						}
						this.form.goods_type_name = res.data.log.goods_type_id_text
						this.form.region = res.data.log.region_text
						this.form.bankRegion = res.data.log.bankregion
						this.form.reg_region = res.data.log.reg_region_text
						this.form.mcc_name = res.data.log.mcc_text
						this.form.bank_name = res.data.log.bank_code_text
						this.form.certStartDate = res.data.log.cert_begin_date
						this.form.certEndDate = res.data.log.cert_end_date
						this.form.legalCertStartDate = res.data.log.legal_cert_begin_date
						this.form.legalCertEndDate = res.data.log.legal_cert_end_date
						this.form.inside_images = res.data.log.inside_images.join(',')
						this.form.category_name = res.data.log.category_text
						this.form.ent_type_name = res.data.log.ent_type_text
						
						this.log = res.data.log
					}
				})
			},
			uploadSuccess(files, name){
				this.upload(files).then(res=> {
					if(res.length>0) {
						if(name === 'inside_images'){
							let arr = this.form[name] ? this.form[name].split(',') : []
							arr.push(this.$_BASE_IMG_API + res[0])
							this.form[name] = arr.join(',')
						}else{
							this.form[name] = this.$_BASE_IMG_API + res[0]
						}
						
					}
				})
			},
			oversize(file,lists,name){
				console.log('超出大小',{file,lists,name});
				if(file.size > 2 * 1024 * 1024){
					console.log(this.$u.toast);
					this.$u.toast('上传文件不能超过2M')
				}
				
			},
			submit() {
				console.log(this.form);
				this.$refs.uForm.validate(valid => {
					if (valid) {
						console.log('验证通过');
						let files1 = this.$refs.uUpload1.lists
						if(!files1.length) return this.$u.toast('请上传商家LOGO', 2000)
						let files2 = this.$refs.uUpload2.lists
						if(!files2.length) return this.$u.toast('请上传商家门面图片', 2000)
						let files3 = this.$refs.uUpload3.lists
						if(files3.length !== 2) return this.$u.toast('请上传2张商家店内图片', 2000)
						// let files4 = this.$refs.uUpload4.lists
						// if(!files4.length) return this.$u.toast('请上传银行卡正面照片', 2000)
						// let task1 = this._upload(files1, 1)
						// let task2 = this._upload(files2, 2)
						// let task3 = this._upload(files3, 3)
						// let task4 = this._upload(files4, 3)
						uni.showLoading()
						// Promise.all([task1, task2, task3]).then((res)=> {
						// 	uni.hideLoading()
						// 	this.form.logo_image = res[0].join(',')
						// 	this.form.face_image = res[1].join(',')
						// 	this.form.inside_images = res[2].join(',')
						// 	console.log('applyForm_1', this.form);
							uni.setStorageSync('applyForm_1', this.form)
							uni.navigateTo({
								url: '/pages/mine/mineEnterPages/mineEnterCertify/mineEnterCertify?type='+0
							})
						// })
					}
				});
			},
			_merchCategorys() {
				this.$ShowLoading()
				console.log(this.form.type);
				let api = this.form.type === 1 ? 'getMerchCategoryList0' : 'getMerchCategoryList'
				SupplierCenterApi[api]().then(res => {
				  console.log('商户分类', res);
					this.$HideLoading()
					if(res.code == 1){
						this.typeList  = res.data.data
					}
				})
			},
			changeType(e){
				console.log(e);
				this._merchCategorys()
			},
			_upload(lists, type) {
			 return new Promise((resolve,reject)=> {
				 this.upload(lists).then(res=> {
						resolve(res)
				 })
			 })	
				
			},
			confirm(data) {
				console.log(data);
				this.form.category_name = data[0].label
				this.form.category_id = data[0].value
				console.log(this.form);
			},
			goodsTypeConfirm(data) {
				console.log(data);
				this.form.goods_type_name = data[0].label
				this.form.goods_type_id = data[0].value
				console.log(this.form);
			},
			entTypeConfirm(data) {
				console.log(data);
				this.form.ent_type_name = data[0].label
				this.form.ent_type = data[0].value
				console.log(this.form);
			},
			confirmRegion(e) {
				console.log(e);
				this.form.region = `${e.province.label},${e.city.label},${e.area.label}`
			},
			// confirmBankRegion(e) {
			// 	console.log(e);
			// 	this.form.bankRegion = `${e.province.label},${e.city.label}`
			// 	this.form.bank_prov_id = e.province.value
			// 	this.form.bank_area_id = e.city.value
			// },
			confirmBankRegion(e) {
				console.log('省市',e);
				let {AreaList} = this
				this.form.bankRegion = `${AreaList[0][e[0]].name},${AreaList[1][e[1]].name}`
				this.form.bank_prov_id = AreaList[0][e[0]].id
				this.form.bank_area_id = AreaList[1][e[1]].id
			},
			async columnchange(e){
				console.log(e);
				let {column,index} =e
				this.select[column] = e.index
				if(column==0){
					let res = await SupplierCenterApi.getArea({
						level:2,
						p_id: this.AreaList[column][index].id
					})
					this.$set(this.AreaList,[1],res.data)
				}
			},
			_getMccList(){
				SupplierCenterApi.getMccList().then(res => {
					if(res.code == 1){
						this.mccList  = res.data
						SupplierCenterApi.getMccList({ level:2, p_id: this.mccList[0].id }).then(res1 => {
							if(res1.code == 1){
								this.mccList2  = res1.data
								SupplierCenterApi.getMccList({ level:3, c_id: this.mccList2[0].id }).then(res2 => {
									if(res2.code == 1){
										this.mccList3  = res2.data
									}
								})
							}
						})
					}
				})
			},
			_getApplyBankList(){
				SupplierCenterApi.getApplyBankList().then(res => {
					if(res.code == 1){
						this.applyBankList  = res.data
					}
				})
			},
			mccConfirm(data) {
				console.log(data);
				let mcc_name = this.mccList3[data[2]].name
				let mcc = this.mccList3[data[2]].code
				this.form.mcc_name = mcc_name
				this.form.mcc = mcc
				console.log(this.form);
			},
			mccColumnchange(data) {
				let { column, index } = data
				this.mccSelector[column] = index
				if(column==0){
					SupplierCenterApi.getMccList({ level:2, p_id: this.mccList[index].id }).then(res1 => {
						if(res1.code == 1){
							this.mccList2  = res1.data
							SupplierCenterApi.getMccList({ level:3, c_id: this.mccList2[0].id }).then(res2 => {
								if(res2.code == 1){
									this.mccList3  = res2.data
								}
							})
						}
					})
				}else if(column==1){
					SupplierCenterApi.getMccList({ level:3, c_id: this.mccList2[index].id }).then(res => {
						if(res.code == 1){
							this.mccList3  = res.data
						}
					})
				}
			},
			applyBankConfirm(data) {
				console.log(data);
				this.form.bank_name = data[0].label
				this.form.bank_code = data[0].value
			},
			certStartChange(e) {
				console.log(e);
				this.form.certStartDate = e.year + '-' + e.month + '-' + e.day
				this.form.cert_begin_date =  e.year + e.month + e.day
			},
			certEndChange(e) {
				console.log(e);
				this.form.certEndDate = e.year + '-' + e.month + '-' + e.day
				this.form.cert_end_date =  e.year + e.month + e.day
			},
			legalCertStartChange(e) {
				console.log(e);
				this.form.legalCertStartDate = e.year + '-' + e.month + '-' + e.day
				this.form.legal_cert_begin_date =  e.year + e.month + e.day
			},
			legalCertEndChange(e) {
				console.log(e);
				this.form.legalCertEndDate = e.year + '-' + e.month + '-' + e.day
				this.form.legal_cert_end_date =  e.year + e.month + e.day
			},
			radioChange(type){
				if(type=='cert_validity_type'){
					this.form.certStartDate = null
					this.form.cert_begin_date =  null
					this.form.certEndDate = null
					this.form.cert_end_date =  null
				}else{
					this.form.legalCertStartDate = null
					this.form.legal_cert_begin_date =  null
					this.form.legalCertEndDate = null
					this.form.legal_cert_end_date =  null
				}
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
